package com.yurembo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yurembo.DAO.GoodsDAO;
import com.yurembo.entity.Goods;

@Service
public class GoodsServiceImpl implements GoodsService {
	
	@Autowired
	GoodsDAO goodsDAO;

	@Override
	@Transactional
	public void addGoods(Goods goods) {
		goodsDAO.addGoods(goods);
	}

	@Override
	@Transactional
	public void remove(Goods goods) {
		goodsDAO.remove(goods);
	}

	@Override
	@Transactional
	public List<Goods> getAllGoods() {
		return goodsDAO.getAllGoods();
	}

	@Override
	@Transactional
	public Goods getGoodsById(long id) {
		return goodsDAO.getGoodsById(id);
	}

}
